﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HotFix_Project.HotFixBugs;

namespace HotFix_Project
{
    class HotFixBugsManager
    {
        public static bool OpenBugFixReg = true;
        //注册需要替换的Mono委托字段
        //可以通过查看ILSpy等软件了解对应出bug的函数的委托字段
        public static void RegDelegate()
        {
            if (!OpenBugFixReg)
            {
                return;
            }
            //注册需要修复的bug
            //LCLFieldDelegateName.__LCL_HelloWorld__Update_Void__Delegate += Fixed_LCL_HelloWorld__Update_Void__Delegate.NewFunction;
            LCLFieldDelegateName.__LCL_HotfixModule__TestBugFunc_Void__Delegate += Fixed_LCL_HelloWorld__Update_Void__Delegate.NewFunction;

        }

        public static void UnregDelegate()
        {
            if (!OpenBugFixReg)
            {
                return;
            }
            //注册需要修复的bug
            //LCLFieldDelegateName.__LCL_HelloWorld__Update_Void__Delegate += Fixed_LCL_HelloWorld__Update_Void__Delegate.NewFunction;
            LCLFieldDelegateName.__LCL_HotfixModule__TestBugFunc_Void__Delegate -= Fixed_LCL_HelloWorld__Update_Void__Delegate.NewFunction;

        }
    }
}
